import matplotlib.pylab as plt
import pandas as pd

df = pd.read_excel('cjd.xlsx', index_col=0)

plt.rcParams['font.sans-serif'] = 'SimHei'
x = df['数学']
plt.xlabel('数学')
plt.ylabel('人数')
plt.title('不同数学成绩区间分布直方图')
plt.hist(x, bins=12, color=(0.894, 0, 0.498), edgecolor='k')
plt.show()
